package com.ruoyi.ommpuser.mapper;

import java.util.List;
import com.ruoyi.ommpuser.domain.OmMpuser;
import org.apache.ibatis.annotations.Select;

/**
 * 问诊用户Mapper接口
 * 
 * @author ningyi
 * @date 2025-02-10
 */
public interface OmMpuserMapper 
{
    /**
     * 查询问诊用户
     * 
     * @param mpuserId 问诊用户主键
     * @return 问诊用户
     */
    public OmMpuser selectOmMpuserByMpuserId(Long mpuserId);

    /**
     * 查询问诊用户列表
     * 
     * @param omMpuser 问诊用户
     * @return 问诊用户集合
     */
    public List<OmMpuser> selectOmMpuserList(OmMpuser omMpuser);

    /**
     * 新增问诊用户
     * 
     * @param omMpuser 问诊用户
     * @return 结果
     */
    public int insertOmMpuser(OmMpuser omMpuser);

    /**
     * 修改问诊用户
     * 
     * @param omMpuser 问诊用户
     * @return 结果
     */
    public int updateOmMpuser(OmMpuser omMpuser);

    /**
     * 删除问诊用户
     * 
     * @param mpuserId 问诊用户主键
     * @return 结果
     */
    public int deleteOmMpuserByMpuserId(Long mpuserId);

    /**
     * 批量删除问诊用户
     * 
     * @param mpuserIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteOmMpuserByMpuserIds(Long[] mpuserIds);

    //selectOmMpuserByOpenId

    @Select("select mpuser_id as mpuserId,mpuser_openid as mpuserOpenid,  " +
            "mpuser_avatar as mpuserAvatar ," +
            "mpuser_nickname as mpuserNickname, " +
            "mpuser_phone as mpuserPhone, " +
            "mpuser_name as mpuserName, " +
            "mpuser_age as mpuserAge, " +
            "mpuser_sex as mpuserSex, " +
            "mpuser_remark as  mpuserRemark, " +
            "mpuser_createtime as mpuserCreatetime, " +
            "mpuser_updatetime as mpuserUpdatetime " +
            "from om_mpuser where mpuser_openid = #{openid}")
    public OmMpuser selectOmMpuserByOpenId(String openid);
}
